import { Suspense, lazy } from 'react'
import { Outlet, type RouteObject } from 'react-router-dom'
import { Spin } from 'antd'

const User = lazy(() => import('@/views/user'))

const routes: RouteObject[] = [
  {
    path: 'sys',
    element: <Outlet />,
    children: [
      {
        path: 'user',
        element: (
          <Suspense fallback={<Spin size='large' />}>
            <User />
          </Suspense>
        )
      }
    ]
  }
]

export default routes
